<template>
	<view>
		<view class="bgFill flex flex-direction align-center">
			<view class="balance">￥{{wallet.balance}}</view>
			<text style="font-size: 24upx;color: #ffc4c6;">余额(元)</text>
			<view style="font-size: 26upx;margin-top: 20upx;">审核中：￥{{wallet.freeze || '0'}}</view>
			<view class="btns flex align-center justify-between">
				<view @click="toTransfer">去转账</view>
				<view @click="toWithdrawal">去提现</view>
			</view>
		</view>
		<view class="linkBox">
			<navigator url="/pages/WB/integralInfo?type=1" class="linkItem flex align-center justify-between">
				<text>余额明细</text>
				<view>
					<image class="rightLogo" src="../../static/image/icon/right.png"></image>
				</view>
			</navigator>
			<!-- <view class="linkItem flex align-center justify-between">
				<text>体验区明细</text>
				<view>
					<image class="rightLogo" src="../../static/image/icon/right.png"></image>
				</view>
			</view>
			<view class="linkItem flex align-center justify-between">
				<text>推广区明细</text>
				<view>
					<image class="rightLogo" src="../../static/image/icon/right.png"></image>
				</view>
			</view> -->
			<navigator url="/pages/WB/withdrawalRecode?btype=1" class="linkItem flex align-center justify-between">
				<text>提现明细</text>
				<view>
					<image class="rightLogo" src="../../static/image/icon/right.png"></image>
				</view>
			</navigator>
			<navigator url="/pages/WB/resetPassword" class="linkItem flex align-center justify-between">
				<text>设置支付密码</text>
				<view class="flex align-center">
					<text v-if="!wallet.is_pass" style="font-size: 24upx;color: red;">未设置</text>
					<text v-else class="bindText">已设置</text>
					<image class="rightLogo" src="../../static/image/icon/right.png"></image>
				</view>
			</navigator>
			<navigator url="/pages/WB/bindzfb?type=3" class="linkItem flex align-center justify-between">
				<text>微信账号</text>
				<view class="flex align-center">
					<text v-if="wallet.is_wechat" class="bindText">已绑定</text>
					<image class="rightLogo" src="../../static/image/icon/right.png"></image>
				</view>
			</navigator>
			<navigator url="/pages/WB/bindzfb?type=2" class="linkItem flex align-center justify-between">
				<text>支付宝账号</text>
				<view class="flex align-center">
					<text v-if="wallet.is_ali" class="bindText">已绑定</text>
					<image class="rightLogo" src="../../static/image/icon/right.png"></image>
				</view>
			</navigator>
			<navigator url="/pages/WB/bankList?type=1" class="linkItem flex align-center justify-between">
				<text>我的银行卡</text>
				<view>
					<image class="rightLogo" src="../../static/image/icon/right.png"></image>
				</view>
			</navigator>
			<!-- <navigator url="/pages/WB/auth" class="linkItem flex align-center justify-between">
				<text>我的认证</text>
				<view class="flex align-center">
					<text style="font-size: 24upx;">未认证</text>
					<image class="rightLogo" src="../../static/image/icon/right.png"></image>
				</view>
			</navigator> -->
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				wallet: ''
			};
		},
		onShow() {
			this.loadData()
		},
		methods: {
			loadData(id) {
				this.$sloading()
				this.$request({
					url: this.$api.wallet.get_balance,
					data: {
						b_type: 1
					}
				}).then(info => {
					this.$hloading()
					if (info.code == 0) {
						this.wallet = info.data
					}
				}).catch(info => {
					this.$hloading()
				})
			},
			toTransfer() {
				uni.navigateTo({
					url: '/pages/WB/transfer?type=1'
				})
			},
			toWithdrawal(){
				uni.navigateTo({
					url:'/pages/WB/withdrawal?type=1'
				})
			}
		}
	}
</script>

<style scoped>
	.bindText{
		font-size: 24upx;
		color: #63BE72;
	}
	.rightLogo {
		width: 18upx;
		height: 30upx;
		margin-left: 20upx;
	}

	.linkItem {
		line-height: 30upx;
	}

	.linkItem {
		height: 80upx;
		font-size: 28upx;
		border-bottom: 1px solid #eee;
	}

	.btns {
		width: 400upx;
		margin-top: 30upx;
	}

	.linkBox {
		width: 700upx;
		background: #fff;
		margin: -40upx auto 0;
		padding: 20upx;
		border-radius: 20upx;
	}

	.btns view {
		width: 160upx;
		font-size: 26upx;
		text-align: center;
		line-height: 50upx;
		border: 1px solid #fff;
	}

	.balance {
		line-height: 80upx;
		font-size: 32upx;
		font-weight: bold;
		color: #fff;
	}

	.bgFill {
		background-image: url(../../static/image/WB/wBg.png);
		background-size: 100% 100%;
		width: 100%;
		padding-bottom: 70upx;
		color: #fff;
	}

	page {
		background: #f5f5f5;
	}
</style>
